package android_design_mode.chapter07_strategy;

public class TranficCalculator {

    private CalculateStrategy mStrategy;


    public static void main(String[] args) {
        TranficCalculator calculator = new TranficCalculator();
        calculator.setStrategy(new BusStrategy());
//        calculator.setStrategy(new SubwayStrategy());
        int price = calculator.calculatePrice(11);
        System.out.println("price -- : " + price);

    }


    public void setStrategy(CalculateStrategy mStrategy) {
        this.mStrategy = mStrategy;
    }

    public int calculatePrice(int km) {
        return mStrategy.calculatePrice(km);
    }


}
